#pragma once
#include "Game.h"
#include "..\dxstdafx.h"
#include "Settings.h"

namespace ds {

class CFramework {

public:
	CFramework(CGame* game);
	~CFramework();
	void initialize(HINSTANCE hInstance,const Settings& settings);
	void Run();
	void Release();
	void ToggleFullscreen();
	static LRESULT CALLBACK StaticWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); 	
	LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
private:		
	void OnCreateDevice();
	void OnResetDevice();
	void OnLostDevice();
	void OnDestroyDevice();
	void Shutdown();
	void OnUpdateFrame(float elapsedTime);
	void OnRenderFrame();

	HWND m_hWnd;
	HINSTANCE m_hInstance;
	BOOL m_active;
	int m_windowWidth;
	int m_windowHeight;
	WINDOWPLACEMENT m_wp;	
	
	DWORD g_dCurTime;
	float g_fElapsedTime;
	DWORD g_dLastTime;
	bool m_Initialized;
	Settings m_Settings;

	CGame* m_Game; 

	double totalTime;
	double accumulator;
	double currentTime;
};

};

